/*
* // +-------------------------------------------------------------------------------------------------
* // |                 有你就好 [ 有节骨乃坚，无心品自端 ]     <http://encoding.wang>
* // +-------------------------------------------------------------------------------------------------
* // |                             独在异乡为异客         每逢佳节倍思亲
* // +-------------------------------------------------------------------------------------------------
* // |                 联系:   <707069100@qq.com>      <http://weibo.com/513778937>
* // +-------------------------------------------------------------------------------------------------
*/

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                   ErYang出品 属于小极品          共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------


package wang.encoding.mroot.service.system


import wang.encoding.mroot.common.service.BaseService
import wang.encoding.mroot.model.entity.system.Role
import java.math.BigInteger

/**
 * 后台 角色 Service 接口
 *
 * @author ErYang
 */
interface RoleService : BaseService<Role> {


    /**
     * 初始化新增 Role 对象
     *
     * @param role Role
     * @return Role
     */
    fun initSaveRole(role: Role): Role

    // -------------------------------------------------------------------------------------------------

    /**
     * 初始化修改 Role 对象
     *
     * @param role Role
     * @return Role
     */
    fun initEditRole(role: Role): Role

    // -------------------------------------------------------------------------------------------------

    /**
     * Hibernate Validation 验证
     */
    fun validationRole(role: Role): String?

    // -------------------------------------------------------------------------------------------------

    /**
     * 新增 角色
     *
     * @param role Role
     * @return ID  BigInteger
     */
    fun saveBackId(role: Role): BigInteger?

    // -------------------------------------------------------------------------------------------------

    /**
     * 更新 角色
     *
     * @param role Role
     * @return ID  BigInteger
     */
    fun updateBackId(role: Role): BigInteger?

    // -------------------------------------------------------------------------------------------------

    /**
     * 删除 角色 (更新状态)
     *
     * @param id BigInteger
     * @return ID  BigInteger
     */
    fun removeBackId(id: BigInteger): BigInteger?

    // -------------------------------------------------------------------------------------------------

    /**
     * 恢复 角色 (更新状态)
     *
     * @param id BigInteger
     * @return ID  BigInteger
     */
    fun recoverBackId(id: BigInteger): BigInteger?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据标识查询 role
     *
     * @param name 标识
     * @return Role
     */
    fun getByName(name: String): Role?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据名称查询 role
     *
     * @param title 名称
     * @return Role
     */
    fun getByTitle(title: String): Role?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据用户 id 查询角色
     *
     * @param userId 用户id
     * @return Role
     */
    fun getByUserId(userId: BigInteger): Role?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据用户 id 查询角色
     *
     * @param userId 用户id
     * @return Set<Role>
     */
    fun listByUserId(userId: BigInteger): Set<Role>?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据用户 id 查询角色 id
     *
     * @param userId 用户id
     * @return id 集合字符串
     */
    fun listIdByUserId2String(userId: BigInteger): String?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据 用户 id 和 角色 id 批量新增 用户-角色 表
     *
     * @param userId BigInteger
     * @param roleIdArray Array<BigInteger>
     *
     * @return Int
     */
    fun saveBatchByUserIdAndRoleIdArray(userId: BigInteger, roleIdArray: Array<BigInteger>): Int?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据 用户 id 和 角色 id 批量删除 用户-角色 表
     *
     * @param userId BigInteger
     * @param roleIdArray Array<BigInteger>
     *
     * @return Int
     */
    fun removeBatchByUserIdAndRoleIdArray(userId: BigInteger, roleIdArray: Array<BigInteger>?): Int?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据 用户id 删除 用户-角色 表
     *
     * @param userId BigInteger
     *
     * @return Int
     */
    fun removeByUserId(userId: BigInteger): Int?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据 用户id 删除 删除 用户-角色 表
     *
     * @param userIdArray  Array<BigInteger>
     *
     * @return Int
     */
    fun removeByUserIdArray(userIdArray: ArrayList<BigInteger>?): Int?

    // -------------------------------------------------------------------------------------------------

}

// -----------------------------------------------------------------------------------------------------

// End RoleService interface

/* End of file RoleService.kt */
/* Location: ./src/main/kotlin/wang/encoding/mroot/service/system/Role.kt */

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                           ErYang出品 属于小极品  O(∩_∩)O~~   共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------
